package pms.complain;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import pms.contract.service.GenericGenerator;
import pms.complain.admin.domain.Complain;

public class ComplainEntityGenerator extends GenericGenerator {

	@Autowired
	ComplainManager complainManager;

	@Test
	public void gen_complain() 
	{
		for (int i = 0; i < 10; i++) 
		{
			Complain complain = new Complain();
			complain.setReason("Reason_" + i);
			this.complainManager.save(complain);
			for (int j = 0; j < 10; j++) 
			{
				Complain e = new Complain();
				e.setEmployeeID("employeeID:" + i);
				e.setReason("Reason:"+i);
				
				complain = this.complainManager.save(e);
				this.complainManager.save(complain);
			}
		}
	}
}
